<template>
 <div>
    <ul class="guessList" v-if="searchList.length">
      <li v-for="(item1,index1) in searchList" :key="index1">
        <a :href="'../detail/main?type=1&join_id=0&limit_id=0&group_id=0&goods_id='+item1.goods_id">
          <div class="img">
            <img :src="item1.image" alt="">
          </div>
          <p class="guessListName">
            {{item1.goods_name}}
          </p>
          <p class="guessListPrice">
            <span>￥<span style="font-size: 17px">{{item1.sell_price}}</span></span>
            <span style="color:#F3891B;float:right;vertical-align:middle"><img src="/static/img/fire.png" alt="" style="width:12px;height: 12px;vertical-align:middle;margin-right: 3px"><span style="vertical-align:middle">{{item1.popularity}}</span></span>
          </p>
        </a>
      </li>
    </ul>
    <div v-else class="foundNot">
      <div >
        <img src="/static/img/notFound.png" alt="">
        <p>搜索不到“{{searchContent}}”</p>
      </div>
    </div>
  </div>
</template>
<script>
  /*import PullTo from 'vue-pull-to';*/
  import request from "@/actions/request.js"
  export default {
    name: "searchList",
    /*components: {
      PullTo
    },*/
    data() {
      return {
        data:{},
        page:1,
        allPage:1,
        searchContent:'',
        searchList:[],
        loading:false,
        BOTTOM_DEFAULT_CONFIG: {
          pullText: "上滑继续加载",
          triggerText: "释放更新",
          loadingText: "加载中,请稍后",
          doneText: "内容已全部展示了",
          failText: "加载失败",
          loadedStayTime: 1000,
          stayDistance: 50,
          triggerDistance: 50,
        },
      }
    },
    watch:{

    },
    methods:{

    },
    mounted() {
      this.searchContent=this.$root.$mp.query.keyword;
      request.searchGoods('api/goods/searchGoods','post',{
        page:this.page,
        keyword:this.searchContent,
      },{},true,this);
    },
  }
</script>
<style lang="scss">
  .guessListName{
    overflow:hidden;
    text-overflow:ellipsis;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    -moz-box-orient:vertical;
    -moz-line-clamp:2;
    height: 11vw;
    line-height: 5.5vw;
    margin: 12px;
    font-size: 13px;
    color: #333333;
    margin-bottom: 0px;
  }
  .guessListPrice{
    margin:0 12px;
    line-height: 40px;
    span{
      color:#FF4C50;
      font-size: 12px;
    }
  }
  .guessList{
    display:flex;
    justify-content: space-between;
    width: 92vw;
    margin: 0 auto;
    flex-wrap: wrap;
    li{
      width:44vw;
      border-radius: 8px;
      overflow: hidden;
      background :#f5f5f5;
      margin-bottom: 15px;

      .img{
        width: 44vw;
        height: 44vw;
        vertical-align: middle;
        line-height: 44vw;
        overflow: hidden;
        background: #ffffff;
      }
      img{
        width: 100%;
        height: 100%;
        vertical-align: middle;
      }
    }
  }
  .foundNot{
    text-align: center;
    padding-top: 90px;
    img{
      width: 120px;
      height:120px;
      margin-bottom: 20px;
    }
  }
</style>

